package tool

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

const (
	SUCCESS int = 0
	FAILED  int = 1
)

func Success(ctx *gin.Context,v interface{})  {
	ctx.JSON(http.StatusOK, map[string]interface{}{
		"code" : SUCCESS,
		"message" : "请求成功",
		"data" : v,
	})
}

func Failed(ctx *gin.Context,v interface{})  {
	ctx.JSON(http.StatusOK, map[string]interface{}{
		"code" : FAILED,
		"message" : v,
	})
}

